/**
 * 版权所有 (C), 2019-2019, XXX有限公司
 * 项目名：com.company.study.designpatterns.observer
 * 文件名: UserInfo
 * 日期: 2019/6/16 13:56
 * 说明:
 */
package com.company.study.designpatterns.observer;

/**
 * 被观察者
 *
 * @author Anbang713
 * @create 2019/6/16
 */
public class UserInfo extends AbstractSubject {

    /**
     * 昵称
     */
    private String nickName;
    /**
     * 密码
     */
    private String password;

    /**
     * 修改密码
     *
     * @param password
     */
    public void updatePassword(String password) {
        this.password = password;
        this.notifyObserver(password);
    }

    public UserInfo(String nickName, String password) {
        this.nickName = nickName;
        this.password = password;
    }

    public String getNickName() {
        return nickName;
    }

    public void setNickName(String nickName) {
        this.nickName = nickName;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }
}